#ifndef AISINO_UTILS
#define AISINO_UTILS

#include <string>
#include <ostream>
#include <exception>


class AisinoException : public std::exception
{
public:
    AisinoException(const std::string& msg);
    ~AisinoException();

private:
    std::string msg;

public:
    virtual const char* what() const noexcept override;

};

class AisinoUtils
{
private:
    AisinoUtils();
    ~AisinoUtils();
public:
    static std::string StringIgnoreSign(std::string text);
    static std::string getInnerText(std::string text,std::string prefix,std::string suffix);
    static bool writeLine(std::ostream& ostream,std::string text);
    static bool isStringWithTag(const std::string& text,const std::string& tag);
    static std::string getStringBehindTag(const std::string& text,const std::string& tag) throw(AisinoException&);
    static std::string getStringFrontTag(const std::string& text,const std::string& tag) throw(AisinoException&);
    static std::string stringInsertLineFrontTag(const std::string& text,const std::string& tag);

private:
    static std::string replaceStr(std::string text,std::string oldtext,std::string newtext);

};



#endif // AISINO_UTILS
